﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;

namespace Cxx.DAL
{
    public class DataAccess
    {
        protected const string DATA_BASE_NAME = "cxxmanagement";

        private static readonly string connectStr = ConfigurationManager.ConnectionStrings["dbcon"].ToString();

        protected const string USP_PAGING_PROCEDURE = "sp_viewPage";

        /// <summary>
        /// 根据数据库名获取连接
        /// </summary>
        /// <returns></returns>
        protected IDbConnection GetConnection()
        {
            var connection = new MySqlConnection(connectStr);
            return connection;
        }
    }
}
